//
//  PhotoAlbumCell.m
//  HomePage
//
//  Created by dlios on 15-1-29.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "PhotoAlbumCell.h"
#import "UIImageView+WebCache.h"
#import "PhotoAlbumViewController.h"
@implementation PhotoAlbumCell
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.labelTitle = [[UILabel alloc] init];
        self.imageViewPhoto = [[UIImageView alloc] init];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.contentView.backgroundColor = [UIColor colorWithRed:225/255.0 green:237/255.0 blue:238/255.0 alpha:1];
    self.labelTitle.frame = CGRectMake(self.contentView.frame.size.width / 3.2, self.contentView.frame.size.height / 10, self.contentView.frame.size.width / 1.6, self.contentView.frame.size.height / 1.6);
    self.labelTitle.textAlignment = NSTextAlignmentLeft;
    //self.labelTitle.backgroundColor = [UIColor blueColor];
    self.labelTitle.font = [UIFont systemFontOfSize:15];
    self.labelTitle.numberOfLines = 0;
    self.labelTitle.text = self.pAA.title;//title
    [self.contentView addSubview:self.labelTitle];
    self.imageViewPhoto.frame = CGRectMake(self.contentView.frame.size.width / 75, self.contentView.frame.size.height / 23.52, self.contentView.frame.size.width / 3.56, self.contentView.frame.size.height / 1.1);
    NSString *str = self.pAA.coverLarge;//coverLarge
    NSURL *url = [NSURL URLWithString:str];
    [self.imageViewPhoto sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"placeholder.jpg"]];
    [self.contentView addSubview:self.imageViewPhoto];
}
@end
